j3deditor.bin.hierarchy
Class J3DeAppearance

java.lang.Object
  extended by j3deditor.bin.hierarchy.HierarchyNode
      extended by j3deditor.bin.hierarchy.J3DeAppearance

public class J3DeAppearance
extends HierarchyNode

Contains and manages an instance of javax.media.j3d.Appearance.

Author:
Risto Seene
See Also:
Appearance

Constructor Summary
J3DeAppearance(javax.media.j3d.Appearance appearance)
          Creates an instance of J3DeAppearance with the given Appearance object and sets capabilities for it.
 
Method Summary
 javax.media.j3d.Appearance getAppearance()
          Returns the Appearance object.
 HierarchyNode getChild(int index)
          Returns the child at the specified index.
 int getIndexOfChild(HierarchyNode child)
          Returns the index of specified child.
 int getNumberOfChildren()
          Returns the number of children.
 J3DeTexture getTexture()
          Returns texture.
 boolean hasMaterial()
          Tests if the Material component of this node exists.
 boolean hasTexture()
          Tests if this appearance node has texture component.
 boolean hasTextureAttributes()
          Tests if this appearance node has texture attributes component.
protected  void removeChild(HierarchyNode child)
          Removes the specified child.
 void setMaterial()
          Applies new material component to this appearance node if none exists.
 void setMaterial(javax.media.j3d.Material material)
          Applies the given material component to this appearance node.
 void setTexture(javax.media.j3d.Texture texture)
          Applies the given texture component to this appearance node.
 void setTextureAttributes()
          Applies new texture attributes component to this appearance node.
 void setTextureAttributes(javax.media.j3d.TextureAttributes ta)
          Applies the given texture attributes component to this appearance node.
 
Methods inherited from class j3deditor.bin.hierarchy.HierarchyNode
clone, equals, getIndex, getParent, getParent, getType, hasNamedChild, setName, setParent, toString, updateName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

J3DeAppearance

public J3DeAppearance(javax.media.j3d.Appearance appearance)
Creates an instance of J3DeAppearance with the given Appearance object and sets capabilities for it.
Capabilities:

Parameters:
appearance - an instance of Appearance
See Also:
SceneGraphObject.setCapability(int capability)
Method Detail

getChild

public HierarchyNode getChild(int index)
Returns the child at the specified index.

Overrides:
getChild in class HierarchyNode
Parameters:
index - index of child
Returns:
Returns the child with the specified index

getNumberOfChildren

public int getNumberOfChildren()
Returns the number of children.

Overrides:
getNumberOfChildren in class HierarchyNode
Returns:
Returns the number of children as integer

getIndexOfChild

public int getIndexOfChild(HierarchyNode child)
Returns the index of specified child.

Overrides:
getIndexOfChild in class HierarchyNode
Parameters:
child - child node which index will be returned
Returns:
Returns the index of specified child

hasMaterial

public boolean hasMaterial()
Tests if the Material component of this node exists.

Returns:
Returns true if the material component of this appearance node exists, otherwise false

setMaterial

public void setMaterial()
Applies new material component to this appearance node if none exists.


setMaterial

public void setMaterial(javax.media.j3d.Material material)
Applies the given material component to this appearance node.

Parameters:
material - new material

hasTexture

public boolean hasTexture()
Tests if this appearance node has texture component.

Returns:
Returns true if the texture component of this appearance node exists, otherwise false

getTexture

public J3DeTexture getTexture()
Returns texture.

Returns:
texture

setTexture

public void setTexture(javax.media.j3d.Texture texture)
Applies the given texture component to this appearance node.

Parameters:
texture - new texture

hasTextureAttributes

public boolean hasTextureAttributes()
Tests if this appearance node has texture attributes component.

Returns:
Returns true if the texture attributes component of this appearance node exists, otherwise false

setTextureAttributes

public void setTextureAttributes()
Applies new texture attributes component to this appearance node.


setTextureAttributes

public void setTextureAttributes(javax.media.j3d.TextureAttributes ta)
Applies the given texture attributes component to this appearance node.

Parameters:
ta - new texture attributes component

getAppearance

public javax.media.j3d.Appearance getAppearance()
Returns the Appearance object.

Returns:
the Appearance object

removeChild

protected void removeChild(HierarchyNode child)
Removes the specified child.

Overrides:
removeChild in class HierarchyNode
Parameters:
child - child that will be removed